package com.work.music;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableScheduling   //启动定时器
@EnableRedisHttpSession(redisNamespace = "com.work.music")
@MapperScan(basePackages = {"com.work.music.dao"})  //扫描mapper包
@ServletComponentScan
@EnableTransactionManagement
public class MusicApplication {

    public static void main(String[] args) {
        SpringApplication.run(MusicApplication.class, args);
    }

//    /**
//     * 自定义定时任务配置
//     * @return
//     */
//    @Bean
//    public TaskScheduler taskScheduler() {
//        ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler();
//        //线程池大小
//        threadPoolTaskScheduler.setPoolSize(10);
//        //线程池名字前缀+
//        threadPoolTaskScheduler.setThreadNamePrefix("springboot-task");
//        return threadPoolTaskScheduler;
//    }
}
